# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-billiard
pkgver=4.2.1
pkgrel=0
#_pkgreal is used by apkbuild-pypi to find modules at PyPI
_pkgreal=billiard
pkgdesc="Python multiprocessing fork with improvements and bugfixes"
url="https://pypi.org/project/billiard/"
arch="noarch"
license="BSD-3-Clause"
makedepends="py3-setuptools py3-wheel py3-gpep517"
checkdepends="py3-psutil py3-pytest py3-nose py3-case"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/b/billiard/billiard-$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"

replaces="py-billiard" # Backwards compatibility
provides="py-billiard=$pkgver-r$pkgrel" # Backwards compatibility

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	# Uses wrong name for 'queue' module.
	# Uses internal 'test' and 'test.support' modules.
	rm -f t/integration/tests/test_multiprocessing.py

	# Windows only
	rm -f t/unit/test_win32.py

	py.test-3
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
f67d2eff08bb8175faf3b638e7566ed6bd22643eb05b3538026618263b9978f2e72fe9cb10c51f596088c1d217e2722969125e266d17a30a4d89ac10738a4818  billiard-4.2.1.tar.gz
"
